package com.jshop.admin.sys.controller;

import com.jshop.admin.sys.entity.SysUserEntity;
import com.jshop.common.constant.AdminConstant;
import com.jshop.common.utils.ShiroUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * Controller公共组件
 *
 */
@Service
public abstract class AbstractController {
    protected Logger logger = LoggerFactory.getLogger(getClass());
    
    protected SysUserEntity getUser() {
        return ShiroUtils.getUserEntity();
    }

    protected Integer getUserId() {
            return getUser().getUserId();
    }

    protected Long getDeptId() {
        return getUser().getDeptId();
    }

    public String redisKey(){
        return AdminConstant.REDIS_KEY+getUserId();
    }




}
